home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.netinfo.com.au!usenet
- From: Alan Brain <aebrain@dynamite.com.au>
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Date: 7 Jan 1996 02:53:41 GMT
- Organization: Netinfo Pty Ltd - Canberra Australia
- Message-ID: <4cncjl$8nq@fred.netinfo.com.au>
- References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <DK6r6I.Itr@eskimo.com>
- NNTP-Posting-Host: dialup6.dynamite.com.au
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- mag@eskimo.com (mAg) wrote:
-
- >Sorry, I cannot agree with you. Hungarianizing the variable names, function names etc. is extremely
- >useful when you are working in team of 20+ programmers working on a huge project with say 40+MB of
- >source code.
- >
- >>This is reminiscent of old batch style COBOL variable naming rules, and our
- >>experience at Realia was that people abandoned these naming conventions
- >>as soon as decent tools were available.
- >>'
- >
- >It is not practical to use these so called tools in large projects, Also for the sake of finding a
- >variable in a large function, it helps to have a variable tell about itself in its name.
- >
- >We at work, use the following naming scheme :
- >
- >a : array
- >b : true or false (Boolean)
- >by: byte (8 bit long)
- >c : char
- >d : difference like dX, dY etc.
- >e : enum
- >f : float
- >g_: global or extern
- >h : handle (under Windows etc)
- >i : integer (as passed in parameter to a function)
- >j : integer (local variable)
- >l : long
- >m_: member variable (under c++)
- >p : pointer
- >q : pointer to a function
- >r : double
- >s : string if an array otherwise a pc (pointer to char)
- >u : unsigned
- >v : dword (32 bit long) int
- >w : word (16 bit long) int
- >
- >And trust me, it helps a lot in deciphering and fixing code by your colleague who broke the program
- >just before going on christmas vacation. :-)
-
- I tend to agree with you. BUT only in context. If you're using C, CMS-2Y
- or any such similar language with a very low/nonexistent level of
- abstraction, it's vital that you are easily able to see the exact
- representation of the variable, otherwise you cannot manipulate it.
- Be aware of the fact that you're laying time-bombs which will explode
- messily during the system's lifetime, as comments and variable names no
- longer are accurate. But IMHO you have to live with that.
-
- Should you be using any high-level language. you'd just get all the
- disbenefits, and none of the benefits - so HN in any high-level language
- is not just useless, it's shooting yourself in the foot. It's horse for
- courses.
-
- Again IMHO any code that's 40 meg or more is a great candidate for a
- high-level language, but I'm showing my religion here.
-
-
-